﻿<Page x:Class="PasswordProvider.View.ViewOptionsPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"   
    xmlns:lib="clr-namespace:PasswordProvider.View.Library"
    xmlns:behavior="clr-namespace:PasswordProvider.View.Behaviors"      
	Title="{Binding DisplayName}"
    ToolTip="{Binding ToolTip}"
    > 
   
    <Grid>
        <Grid.RowDefinitions>            
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        
        <Grid Margin="10,5">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <TextBlock Text="{Binding SkinSelector.DisplayName}" VerticalAlignment="Center"/>
           <lib:MultiComboBox Grid.Column="1"  Margin="3,0,0,0" VerticalAlignment="Center"
                                  SelectionMode="Single"
                                  ToolTip="{Binding SkinSelector.ToolTip}"
                                  ItemsSource="{Binding Path=SkinSelector.List}"
                                  SelectedItem="{Binding Path=SkinSelector.SelectedItem}"
                                  />
        </Grid>
        
        <GroupBox Grid.Row="1" Margin="10,0,10,5" 				
				Header="{Binding ListViewSortMethod.DisplayName}">
            <!-- Using the behaviors for their support of indexed properties in the path -->
            <lib:EnumSelector EnumValue="{Binding ListViewSortMethod.EnumValue}">
                <lib:EnumSelectorDisplayItem
                    DisplayName="{behavior:StringBinding ListViewSortMethod.DisplayItems[0].DisplayName}"
                    ToolTip="{behavior:StringBinding ListViewSortMethod.DisplayItems[0].ToolTip}"
                    EnumValue="{behavior:EnumBinding ListViewSortMethod.DisplayItems[0].EnumValue}" />
                <lib:EnumSelectorDisplayItem
                    DisplayName="{behavior:StringBinding ListViewSortMethod.DisplayItems[1].DisplayName}"
                    ToolTip="{behavior:StringBinding ListViewSortMethod.DisplayItems[1].ToolTip}"
                    EnumValue="{behavior:EnumBinding ListViewSortMethod.DisplayItems[1].EnumValue}" />
                <lib:EnumSelectorDisplayItem
                    DisplayName="{behavior:StringBinding ListViewSortMethod.DisplayItems[2].DisplayName}"
                    ToolTip="{behavior:StringBinding ListViewSortMethod.DisplayItems[2].ToolTip}"
                    EnumValue="{behavior:EnumBinding ListViewSortMethod.DisplayItems[2].EnumValue}" />
            </lib:EnumSelector>                              
            
        </GroupBox>
        
        <GroupBox Grid.Row="2" Margin="10,0,10,5" 				
				Header="{Binding ListViewGroupMethod.DisplayName}">
            <lib:EnumSelector EnumValue="{Binding ListViewGroupMethod.EnumValue}">
                <lib:EnumSelectorDisplayItem
                    DisplayName="{behavior:StringBinding ListViewGroupMethod.DisplayItems[0].DisplayName}"
                    ToolTip="{behavior:StringBinding ListViewGroupMethod.DisplayItems[0].ToolTip}"
                    EnumValue="{behavior:EnumBinding ListViewGroupMethod.DisplayItems[0].EnumValue}" />
                <lib:EnumSelectorDisplayItem
                    DisplayName="{behavior:StringBinding ListViewGroupMethod.DisplayItems[1].DisplayName}"
                    ToolTip="{behavior:StringBinding ListViewGroupMethod.DisplayItems[1].ToolTip}"
                    EnumValue="{behavior:EnumBinding ListViewGroupMethod.DisplayItems[1].EnumValue}" />
                <lib:EnumSelectorDisplayItem
                    DisplayName="{behavior:StringBinding ListViewGroupMethod.DisplayItems[2].DisplayName}"
                    ToolTip="{behavior:StringBinding ListViewGroupMethod.DisplayItems[2].ToolTip}"
                    EnumValue="{behavior:EnumBinding ListViewGroupMethod.DisplayItems[2].EnumValue}" />
            </lib:EnumSelector>
        </GroupBox>
 
        <StackPanel Grid.Row="3" Margin="17,5,0,5">
            <CheckBox 
                IsEnabled="{Binding RunInSystemTray.IsEnabled}"
                Content="{Binding RunInSystemTray.DisplayName}"
                IsChecked="{Binding RunInSystemTray.IsChecked}"
                />
            <CheckBox 
                IsEnabled="{Binding PinWhenDeactivated.IsEnabled}"
                Content="{Binding PinWhenDeactivated.DisplayName}"
                IsChecked="{Binding PinWhenDeactivated.IsChecked}"
                />
            <CheckBox 
                IsEnabled="{Binding AlwaysOnTop.IsEnabled}"
                Content="{Binding AlwaysOnTop.DisplayName}"
                IsChecked="{Binding AlwaysOnTop.IsChecked}"
                />
            <CheckBox
                IsEnabled="{Binding MinimizeToNotificationArea.IsEnabled}"
                Content="{Binding MinimizeToNotificationArea.DisplayName}"
                IsChecked="{Binding MinimizeToNotificationArea.IsChecked}"
                />
            
        </StackPanel>
        <CheckBox Grid.Row="4" Margin="17,10,0,5"
                IsEnabled="{Binding ShowLogOnSiteIcons.IsEnabled}"
                Content="{Binding ShowLogOnSiteIcons.DisplayName}"
                IsChecked="{Binding ShowLogOnSiteIcons.IsChecked}"
                />
        
    </Grid>
</Page>   